/*
Copyright (C) 2009-2010 Xanadu Development Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#pragma once

#include "angelscript.h"
#include "ByteCodeMemory.h"

class Channel;
class PlayerNPC;
class Player;
class Reactor;
class MapPortalData;

class AngelScriptEngine {
private:
	static asIScriptEngine* pScriptEngine;
public:
	static int Initialize();
	static int handleNPC(PlayerNPC* npc, bool complete = false);
	static int handleReactor(Player* player, Reactor* reactor);
	static int handlePortal(Player* player, MapPortalData* portal);
	static int handleChannelEvent(Channel* channel, string& eventn);
	static int LoadScript(asIScriptEngine * pScriptEngine, const char *filename, const char * module = 0);
	static ByteCodeMemory<int>* loadNPC(int id);
	static ByteCodeMemory<int>* loadQuest(int id);
	static ByteCodeMemory<string>* loadPortal(string id);
	static ByteCodeMemory<string>* loadChannelEvent(string id);
	static ByteCodeMemory<int>* loadReactor(int id);
};
